package com.stylefeng.guns.modular.system.dao;

import com.stylefeng.guns.core.datascope.DataScope;
import com.stylefeng.guns.core.node.ZTreeNode;
import com.stylefeng.guns.modular.system.model.GoodsCategory;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author LiuXin
 * @since 2018-09-12
 */
@Repository
public interface GoodsCategoryMapper extends BaseMapper<GoodsCategory> {

    /**
     * 获取ztree的节点列表
     */
    List<ZTreeNode> tree();

    /**
     * 数据权限tree
     * @param dataScope 数据范围
     * @return 列表
     */
    List<ZTreeNode> listTree(DataScope dataScope);

    /**
     * 获取所有部门商品分类
     */
    List<Map<String, Object>> list(@Param("condition") String condition);

    /**
     * 获取商品列表
     */
    List<Map<String,Object>> listGoodsCategory(DataScope dataScope, @Param("condition") String condition);

}
